<!--
 * @Descripttion : 
 * @Autor        : Lilong
 * @Date         : 2022-09-14 11:01:36
 * @LastEditTime : 2022-09-14 12:39:21
 * @FilePath     : \src\AComponent.vue
-->
<template>
    <div>
        <h2>A组件</h2>

        <button @click="handlerClick">按钮</button>
    </div>
</template>

<script>
import Bus from "./bus"

export default {
    name:'AComponent',
    methods:{
        handlerClick(){
            // 自定义事件名 sendMsg
            Bus.$emit("sendMsg", "这是要向外部发送的数据")
        }
    }
}
</script>

<style>

</style>template